export class PersonV3 implements Component {
  private readonly name: string;
  constructor(name: string) {
    this.name = name;
  }

  public Show(): string {
    return `${this.name} 装扮是 `;
  }
}

interface Component {
  Show(): string;
}

export class Decorator implements Component {
  private component: Component | undefined;

  public SetComponent(component: Component) {
    this.component = component;
  }

  public Show(): string {
    if (this.component) {
      return this.component.Show();
    } else {
      return "";
    }
  }
}

export class Shirts extends Decorator {
  Show(): string {
    let outStr = super.Show();
    outStr += "T恤";
    return outStr;
  }
}
export class BigTrouser extends Decorator {
  Show(): string {
    let outStr = super.Show();
    outStr += "垮裤 ";
    return outStr;
  }
}

export class Sneakers extends Decorator {
  Show(): string {
    let outStr = super.Show();
    outStr += "破球鞋 ";
    return outStr;
  }
}

export class Suit extends Decorator {
  Show(): string {
    let outStr = super.Show();
    outStr += "西装 ";
    return outStr;
  }
}
export class Tie extends Decorator {
  Show(): string {
    let outStr = super.Show();
    outStr += "领带 ";
    return outStr;
  }
}
export class LeatherShoes extends Decorator {
  Show(): string {
    let outStr = super.Show();
    outStr += "皮鞋 ";
    return outStr;
  }
}
